package com.ht.common.core.constant.mq;

import org.apache.commons.lang3.StringUtils;

/**
 * 场场联动-申报类型编码与回执类型编码对应关系
 * @Author：hdengxian
 * @Date：2024/4/9 14:32
 */
public enum ReportAndReceiptEnum {
    R_1029_2013("1029","2013","转场作业单申报报文-回执报文类型"),
    R_1030_2014("1030","2014","转场作业的异常处置申报报文-回执报文类型"),
    R_1031_2015("1031","2015","智能锁申报报文-回执报文类型"),
    R_1032_2016("1032","2016","SIM卡申报报文-回执报文类型"),
    R_1033_2017("1033","2017","行程备案申报报文-回执报文类型"),
    R_1034_2024("1034","2024","设备备案(手持机等)申报报文-回执报文类型"),
    R_1035_2018("1035","2018","核放单申报报文-回执报文类型"),
    R_1036_2020("1036","2020","区域围栏申报报文-回执报文类型"),
    R_1045_2019("1045","2019","空水运申报报文-回执报文类型"),
    R_1046_2021("1046","2021","进口提货单申报报文-回执报文类型"),


    ;

    /**申报类型编码**/
    private String reportCode;
    /**回执报文类型编码**/
    private String receiptCode;
    private String name;

    ReportAndReceiptEnum(String reportCode, String receiptCode, String name) {
        this.reportCode = reportCode;
        this.receiptCode = receiptCode;
        this.name = name;
    }

    /**
     * 通过申报类型编码获取回执类型编码
     * @param reportCode
     * @return
     */
    public static String getReceiptCodeByReportCode(String reportCode) {
        if (StringUtils.isBlank(reportCode)) {
            return "0000";
        }
        for (ReportAndReceiptEnum targetObj : ReportAndReceiptEnum.values()) {
            if (reportCode.equals(targetObj.getReportCode())) {
                return targetObj.getReceiptCode();
            }
        }
        return "0000";
    }

    public String getReportCode() {
        return reportCode;
    }

    public void setReportCode(String reportCode) {
        this.reportCode = reportCode;
    }

    public String getReceiptCode() {
        return receiptCode;
    }

    public void setReceiptCode(String receiptCode) {
        this.receiptCode = receiptCode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
